package com.haoting.blogcms.controller;


import com.haoting.blogcms.entity.Banner;
import com.haoting.blogcms.service.BannerService;
import com.haoting.commonutils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/blogcms/bannerfront")
//@CrossOrigin
public class BannerFrontController {

    @Autowired
    private BannerService bannerService;

    //查询所有banner
    @GetMapping("getAllBanner")
    public CommonResult getAllBanner() {
        List<Banner> list = bannerService.selectAllBanner();
        return CommonResult.ok().data("list",list);
    }

}
